package com.rtx.wms.std.validation.cclist;

import java.util.List;

import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;
import com.rtx.api.annotation.DataSourceAnnotation;
import com.rtx.wms.std.cc.bean.ApiCcList;
import com.rtx.wms.std.common.bean.WmsConstant;
import com.rtx.wms.std.erpconfig.bean.RtxErpConfig;
import com.rtx.wms.std.validation.BaseValidation;

@Component
public class CclistCheck extends BaseValidation{

	/**
	 * 常规校验
	 */
	@DataSourceAnnotation
	public void  checkEnterpriseConfig(String datasourekey,ApiCcList cclist) {
		List<RtxErpConfig> configList =	validationErpConfig(WmsConstant.ENTERPRISE, cclist.getLottable01(), cclist.getLottable02());
		cclist.setWhseid(configList.get(0).getWmwhse());
		List<String> skuList = JSON.parseArray(cclist.getSkulist(), String.class);
		
		for(String sku:skuList) {
			validationSku(WmsConstant.ENTERPRISE, "GREPOW", sku, true);
		}
	}
	
	
}
